﻿Imports Equipment.DataAccess

Public Class NotificationTriggerLookup

#Region "Properties"
    Private _type As NotificationTrigger
    Public Property Type As NotificationTrigger
        Get
            Return _type
        End Get
        Set(ByVal value As NotificationTrigger)
            _type = value
        End Set
    End Property

    Private _desc As String
    Public Property Description As String
        Get
            Return _desc
        End Get
        Set(ByVal value As String)
            _desc = value
        End Set
    End Property
#End Region

    Public Shared Function RetrieveAll() As List(Of NotificationTriggerLookup)
        Dim result As New List(Of NotificationTriggerLookup)

        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.AssetType_Create, .Description = "Create Asset Type"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.AssetType_Modify, .Description = "Modify Asset Type"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.AssetStatus_Create, .Description = "Create Asset Status"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.AssetStatus_Modify, .Description = "Modify Asset Status"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.AssetCustomField_Create, .Description = "Create Asset Custom Field"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.AssetCustomField_ModifyMandatoryFlag, .Description = "Modify Mandatory Flag of Asset Custom Field"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.Asset_Create, .Description = "Create Asset"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.Asset_Modify, .Description = "Modify Asset"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.Notification_Create, .Description = "Create Notification"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.Notification_Modify, .Description = "Modify Notification"})

        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.WorkOrder_Create, .Description = "Create Work Order"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.WorkOrder_AutomaticCreate, .Description = "Create Work Order Automatically"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.WorkOrder_AdhocCreate, .Description = "Create Adhoc Work Order"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.WorkOrder_Calibrate, .Description = "Edit Work Order"})

        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.WorkOrder_Overdue_ByHour, .Description = "Work Order Overdue - By Hour"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.WorkOrder_Overdue_ByDay, .Description = "Work Order Overdue - By Day"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.WorkOrder_StatusChange, .Description = "Change Work Order Status"})

        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.Requirement_Create, .Description = "Create Basic Requirement"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.Requirement_Modify, .Description = "Modify Basic Requirement"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.User_Create, .Description = "Create User"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.User_Modify, .Description = "Modify User"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.UserRole_Create, .Description = "Create User Role"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.UserRole_Modify, .Description = "Modify User Role"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.UserGroup_Create, .Description = "Create User Group"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.UserGroup_Modify, .Description = "Modify User Group"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.Holiday_Create, .Description = "Create Holiday"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.Holiday_Modify, .Description = "Modify Holiday"})

        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.DepartmentSetup_CreateSite, .Description = "Create Site"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.DepartmentSetup_ModifySite, .Description = "Modify Site"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.DepartmentSetup_CreateDepartment, .Description = "Create Department"})
        result.Add(New NotificationTriggerLookup With {.Type = NotificationTrigger.DepartmentSetup_ModifyDepartment, .Description = "Modify Department"})


        Return result
    End Function

    Public Shared Function GetDescriptionByType(ByVal type As NotificationTrigger) As String
        Return RetrieveAll().Single(Function(t) t.Type = type).Description
    End Function
End Class
